package com.lovo.project.service.impl;

import com.lovo.project.dao.MapDAO;
import com.lovo.project.model.CityConutDO;
import com.lovo.project.model.ShopInfoDO;
import com.lovo.project.service.MapService;
import com.lovo.project.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @title
 * @author: yuyuan
 * @date: 2020/11/8 14:24
 */
public class MapServiceImpl implements MapService {
    @Override
    public List<CityConutDO> findCountByCity() {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        MapDAO mapDao = sqlSession.getMapper(MapDAO.class);
        List<CityConutDO> list = mapDao.selectCountByCity();
        sqlSession.close();
        return list;
    }

    @Override
    public List<ShopInfoDO> findAllShop() {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        MapDAO mapDao = sqlSession.getMapper(MapDAO.class);
        List<ShopInfoDO> list = mapDao.selectAllShop();
        sqlSession.close();
        return list;
    }
}
